Subject: re: Optimizing E, Assembly and E
From: "Barry D. Wills" <[email-masked]>
To: "amigae" <[email-masked]>
Date: 13 Jul 93 07:19:00 CST

> (; Working on anything lately, Barry?

Not really.  Just cleaning up my hard drive in prep for the arrival of OS2.1.
See my IdentifyProcessors program?  I was especially interested in it because 
I run 2 processors and it's nice to have a system that doesn't have to be told 
how to startup. :)  But I was also thinking of the possibility that E  may be 
producing processor specific code in the near future.  This info could be used 
to make programs more optimal/robust.
 
>queried.. hmmm.. weird. In the second case.. the same. Did Wouter say that
>the new version can output debug symbols?

I don't recall mention of it.  But now would be a good opportunity. :)
 
>> >One last suggestion.. how about making some E functions (such as WriteF)
>> >more assembling friendly, so you can use certain E functions in the middle
>> >of an assembly code? ie. it uses only the upper data/address registers
(4-7)
>> >and leaves the lower ones intact.

>> Wouter told me you can do this:
>>     MOVEM D0-D7/A0-A3,(A7)+  ;/* Save multiple regs, post inc stack (SP). */
>>     WriteF ('whatever')
>>     MOVEM -(A7),D0-D7/A0-A3  ;/* Pre dec stack, restore multiple regs (SP). */

>Good idea, forgot about it. Still, a bit cumbersome, but it's do.
>Btw: The syntax looks pretty much like the correct syntax. (;

Yeah.  If you're lazy, like me, you can make two subroutines at the end of your
program:

savem: 
        MOVEM D0-D7/A0-A3,(A7)+
        RTS

restorem:
        MOVEM -(A7),D0-D7/A0-A3 
        RTS

Then you can use in your program:

        JSR   savem
        WriteF ('E functions to your hearts content...')
        JSR   restorem

I know you already know this.  I'm just posting it because *I* just learned it
myself, and someone else may find this useful.  An excellent debugging tool for
learning assembly.

BTW (Wouter), is A6 free for our use in E?  Should we be saving and restoring 
A0-A3,A6 .vs. only A0-A3?

Later.  -- Barry